package org.lq.com.zpc.ui;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import org.lq.com.zpc.entity.Qsheet;
import org.lq.com.zpc.entity.addQsheet;

import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.ImageIcon;
import javax.swing.JDialog;

import java.awt.Toolkit;
import javax.swing.border.EtchedBorder;

public class ShowQsheetUI extends JDialog {

	private JPanel contentPane;
	private JTextField tlsnum;
	private JTextField tamount;
	private JTextField tbjname;
	private JTextField tusername;
	private JTextField tshbz;
	private static addQsheet aqst=addQsheet.builder().build();
	private JTextField tbzz;
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					ShowQsheetUI frame = new ShowQsheetUI();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public ShowQsheetUI() {
		setModal(true);
		setIconImage(Toolkit.getDefaultToolkit().getImage(ShowQsheetUI.class.getResource("/org/lq/com/zpc/img/CRM_icon_queding.png")));
		setTitle("\u67E5\u770B\u62A5\u4EF7\u8868");
//		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 490, 479);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
		panel.setBounds(0, 10, 464, 126);
		contentPane.add(panel);
		panel.setLayout(null);
		
		JLabel label = new JLabel("\u57FA\u672C\u4FE1\u606F");
		label.setIcon(new ImageIcon(ShowQsheetUI.class.getResource("/org/lq/com/zpc/img/CRM_icon_jichuguanli.png")));
		label.setBounds(20, 10, 91, 15);
		panel.add(label);
		
		JLabel label_1 = new JLabel("\u6D41\u6C34\u53F7 : ");
		label_1.setBounds(10, 35, 54, 15);
		panel.add(label_1);
		
		JLabel label_2 = new JLabel("\u603B\u91D1\u989D : ");
		label_2.setBounds(10, 80, 54, 15);
		panel.add(label_2);
		
		tlsnum = new JTextField();
		tlsnum.setEditable(false);
		tlsnum.setBounds(76, 32, 107, 21);
		panel.add(tlsnum);
		tlsnum.setColumns(10);
		
		tamount = new JTextField();
		tamount.setEditable(false);
		tamount.setBounds(74, 77, 109, 21);
		panel.add(tamount);
		tamount.setColumns(10);
		
		JLabel lblNewLabel = new JLabel("\u62A5\u4EF7\u540D\u79F0 : ");
		lblNewLabel.setBounds(235, 35, 66, 15);
		panel.add(lblNewLabel);
		
		tbjname = new JTextField();
		tbjname.setEditable(false);
		tbjname.setBounds(315, 32, 107, 21);
		panel.add(tbjname);
		tbjname.setColumns(10);
		
		tusername = new JTextField();
		tusername.setEditable(false);
		tusername.setBounds(315, 77, 107, 21);
		panel.add(tusername);
		tusername.setColumns(10);
		
		JLabel label_3 = new JLabel("\u5BA2\u6237\u540D\u79F0 : ");
		label_3.setBounds(235, 80, 66, 15);
		panel.add(label_3);
		
		JPanel panel_1 = new JPanel();
		panel_1.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
		panel_1.setBounds(0, 146, 464, 228);
		contentPane.add(panel_1);
		panel_1.setLayout(null);
		
		JLabel label_4 = new JLabel("\u62A5\u4EF7\u4FE1\u606F");
		label_4.setBounds(20, 10, 54, 15);
		panel_1.add(label_4);
		
		JLabel label_5 = new JLabel("\u5907\u6CE8 : ");
		label_5.setBounds(10, 111, 54, 15);
		panel_1.add(label_5);
		
		tbzz = new JTextField();
		tbzz.setEditable(false);
		tbzz.setBounds(51, 35, 403, 183);
		panel_1.add(tbzz);
		tbzz.setColumns(10);
		
		JLabel label_6 = new JLabel("\u5BA1\u6838\u6B65\u9AA4 : ");
		label_6.setBounds(10, 399, 87, 15);
		contentPane.add(label_6);
		
		tshbz = new JTextField();
		tshbz.setEditable(false);
		tshbz.setBounds(107, 396, 113, 21);
		contentPane.add(tshbz);
		tshbz.setColumns(10);
	}
	public void setaddQsheetinfo(addQsheet qast) {
		this.aqst = qast;	
		tlsnum.setText(qast.getLsnum());
		tusername.setText(qast.getUsername());
		tamount.setText(qast.getAmount());
		tbjname.setText(qast.getBjname());
		tbzz.setText(qast.getBz());
		tshbz.setText(qast.getShbz());
		}
}
